﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
using Microsoft.Practices.EnterpriseLibrary.Common.Configuration;
using Microsoft.Practices.ObjectBuilder2;
using Microsoft.Practices.Unity;
using Microsoft.Practices.Unity.ObjectBuilder;
using Guard=Common.Core.Guard;

namespace Common.Unity.Extensions.Configuration
{
	public class ConfigurationExtension : UnityContainerExtension, IConfigurationExtensionConfiguration
	{
		protected override void Initialize()
		{}

		public void AddStrategy( IBuilderStrategy strategy, UnityBuildStage stage )
		{
			Context.Strategies.Add( strategy, stage );
		}

		public void AddDefaultPolicy( Type policyInterface, IBuilderPolicy policy )
		{
			Context.Policies.SetDefault( policyInterface, policy );
		}
	}
}
